import axios from '@/libs/request/axios'
// 获取待结清合同
export const getStaySettleList = (params) => {
    return axios.request({
        url: `/contractManage/staySettle/getStaySettleList`,
        data: params,
        method: 'post'
    })
}

//保存结清信息
export const saveStaySettle = (params) => {
    return axios.request({
        url: `/contractManage/staySettle/saveStaySettle`,
        data: params,
        method: 'post'
    })
}

//获取待申请的申请编号
export const getStaySettleApplyNoList = (params) => {
    return axios.request({
        url: `/contractBasic/staySettle/getStaySettleApplyNoList`,
        data: params,
        method: 'post'
    })
}

//根据申请编号获取详情
export const getStaySettleDetailByApplyNo = (params) => {
    return axios.request({
        url: `/contractBasic/staySettle/getStaySettleDetailByApplyNo`,
        method: 'post',
        data: params,
    })
}

//计算试算结果
export const calSettleResult = (params) => {
    return axios.request({
        url: `/contractBasic/staySettle/calSettleResult`,
        data: params,
        method: 'post'
    })
}

//根据申请编号获取详情
export const getStaySettleDetailManageByApplyNo = (applyNo) => {
    return axios.request({
        url: `/contractManage/staySettle/getStaySettleDetailByApplyNo/${applyNo}`,
        method: 'post'
    })
}

//根据ID获取详情
export const getStaySettleDetailById = (id) => {
    return axios.request({
        url: `/contractManage/staySettle/getStaySettleDetailById/${id}`,
        method: 'post'
    })
}

//未付逾期利息查询
export const queryUnpayedOverdueInterestDetail = (params) => {
    return axios.request({
        url: `/contractBasic/staySettle/queryUnpayedOverdueInterestDetail`,
        data: params,
        method: 'post'
    })
}

//查询应计逾期利息详情
export const queryOverdueInterestReceivableDetail = (params) => {
    return axios.request({
        url: `/contractBasic/staySettle/queryOverdueInterestReceivableDetail`,
        data: params,
        method: 'post'
    })
}

//查询杂费详情
export const queryOtherCostDetail = (params) => {
    return axios.request({
        url: `/contractBasic/staySettle/queryOtherCostDetail`,
        data: params,
        method: 'post'
    })
}

//查询豁免费用
export const queryExemptAmountDetail = (params) => {
    return axios.request({
        url: `/contractManage/staySettle/queryExemptAmountDetail`,
        data: params,
        method: 'post'
    })
}

//查询豁免罚息
export const queryExemptOverdueInterestDetail = (params) => {
    return axios.request({
        url: `/contractManage/staySettle/queryExemptOverdueInterestDetail`,
        data: params,
        method: 'post'
    })
}


// 获取提前还款任务池
export const getManagePrepaymentApply = (params) => {
    return axios.request({
        url: `/contractManage/staySettle/getManagePrepaymentApply`,
        data: params,
        method: 'post'
    })
}
// 获取生效状态的提前结清记录
export const getValidPrepaymentApply = (params) => {
    return axios.request({
        url: `/contractManage/staySettle/getValidPrepaymentApply`,
        data: params,
        method: 'post'
    })
}

//根据id获取其他信息
export const getApplyInfoById = (params) => {
    return axios.request({
        url: `/contractManage/staySettle/getApplyInfoById`,
        data: params,
        method: 'post'
    })
}
//根据申请编号获取详情
export const getManagePrepaymentApplyById = (id) => {
    return axios.request({
        url: `/contractManage/staySettle/getManagePrepaymentApplyById/${id}`,
        method: 'post'
    })
}

//保存结清信息
export const saveManagePrepaymentApply = (params) => {
    return axios.request({
        url: `/contractManage/staySettle/saveManagePrepaymentApply`,
        data: params,
        method: 'post'
    })
}


// 发起流程
export const trailLaunchProcess = (params) => {
    return axios.request({
        url: '/contractManage/staySettle/trailLaunchProcess',
        data: params,
        method: 'post'
    })
}

// 提交流程
export const trailSubmitProcess = (params) => {
    return axios.request({
        url: '/contractManage/staySettle/trailSubmitProcess',
        data: params,
        method: 'post'
    })
}

// 删除提前还款任务池
export const delManagePrepaymentApplyById = (id) => {
    return axios.request({
        url: `/contractManage/staySettle/delManagePrepaymentApplyById/${id}`,
        method: 'post'
    })
}

// 获取日结日期
export const getBatchDate = (contractNo) => {
    return axios.request({
        url: '/contractBasic/staySettle/getBatchDate',
        params: {
            contractNo,
        },
        method: 'post'
    })
}

//获取提前终止费率
export const getPrepaymentRate = (params) => {
    return axios.request({
        url: `/contractBasic/staySettle/getPrepaymentRate`,
        data: params,
        method: 'post'
    })
}
